<div class="cl pd-5 bg-1 bk-gray mb-10">
  <a class="btn btn-primary radius" onclick="layer_show('添加广告','__MODULE__/Ad/adAddEdit','','510')" href="javascript:;"><i class="Hui-iconfont">&#xe600;</i> 添加广告</a>
  <span class="r mt-3">共有数据：<strong>{$rows}</strong> 条</span>
</div>
<table id="xctable" class="table table-border table-bordered table-hover table-bg table-sort">
  <thead>
    <tr class="text-c">
      <th width="50">编号</th>
      <th width="170" id="ad_pid" onClick="tab_sort(this)"><div class="">广告位置</div></th>
      <th width="100" id="ad_name" onClick="tab_sort(this)"><div class="">广告名称</div></th>
      <th width="90" id="ad_url" onClick="tab_sort(this)"><div class="">广告图片</div></th>
      <th width="200" id="ad_link" onClick="tab_sort(this)"><div class="">广告链接</div></th>
      <th width="60" id="ad_target" onClick="tab_sort(this)"><div class="">新窗口</div></th>
      <th width="60" id="ad_show" onClick="tab_sort(this)"><div class="">是否显示</div></th>
      <th width="60" id="ad_sort" onClick="tab_sort(this)"><div class="">排序</div></th>
      <th width="40">操作</th>
    </tr>
  </thead>
  <tbody>
    <volist name='list' id='vo'>
    <tr class="text-c">
      <td>{$i}</td>
      <td>{$vo.pname}【ID:{$vo.ad_pid}】</td>
      <td>{$vo.ad_name}</td>
      <td><img src="__UPLOAD__/{$vo.ad_url}" onerror="javascript:this.src='__UPLOAD__/img/no_image.jpg'" width="100" height="50" /></td>
      <td class="text-l">{$vo.ad_link}</td>
      <td><img width="20" src="__PUBLIC__/admin/images/<if condition='($vo[ad_target] eq 1)'>y.png<else />n.png</if>" onclick="changeTableVal('ad','ad_id={$vo.ad_id}','ad_target',this)"/></td>
      <td><img width="20" src="__PUBLIC__/admin/images/<if condition='($vo[ad_show] eq 1)'>y.png<else />n.png</if>" onclick="changeTableVal('ad','ad_id={$vo.ad_id}','ad_show',this)"/></td>
      <td><input class="input-text text-c" onkeyup="this.value=this.value.replace(/[^\d.]/g,'')" onpaste="this.value=this.value.replace(/[^\d.]/g,'')"  onchange="ajaxUpFieldValue('ad','ad_id={$vo.ad_id}','ad_sort',this);" value="{$vo.ad_sort}" type="text"></td>
      <td class="td-manage">
        <a onclick="layer_show('修改广告','__MODULE__/Ad/adAddEdit?aid={$vo.ad_id}','','510')" href="javascript:;"  class="ml-5"><i class="Hui-iconfont">&#xe6df;</i></a>
        <a style="text-decoration:none" href="javascript:;" onclick="del(this,'{$vo.ad_id}')" title="删除"><i class="Hui-iconfont">&#xe609;</i></a>
      </td>
    </tr>
    </volist>
  </tbody>
</table>
{$page}<!-- 分页-->
<script type="text/javascript">
$(".pagination a").click(function(){
	var page = $(this).data('p');
	ajax_get_table('myfrom1',page);
});
</script>